﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using MonPocGarage.ArmyContracts;
using MonPocGarage.ArmyContracts.Common.Enums;
using MonPocGarage.ArmyData;

namespace MonPocGarage.GUI.Helpers
{
    public static class BuildArmy
    {
        private static ArmyDataMgr m_ArmyDataMgr = new ArmyDataMgr();

        public static List<Monster> GetMonsters()
        {
            return m_ArmyDataMgr.GetMonsterList();
        }

        public static List<Monster> GetMonsters(string faction)
        {
            return m_ArmyDataMgr.GetMonsterList().Where(m => m.Faction.ToString() == faction).ToList();
        }

        public static List<Unit> GetUnits()
        {
            return m_ArmyDataMgr.GetUnitList();
        }

        public static List<Unit> GetUnits(string faction)
        {
            return m_ArmyDataMgr.GetUnitList().Where(m => m.Faction.ToString() == faction).ToList();
        }

        public static List<Building> GetBuildings()
        {
            return m_ArmyDataMgr.GetBuildingList();
        }

        public static void RefreshData()
        {
            m_ArmyDataMgr = new ArmyDataMgr();
        }

        public static List<string> GetFactions()
        {
            return Enum.GetNames(typeof(Faction)).Where(f => f != Faction.Civilian.ToString()).ToList();
        }

    }
}
